import request from '@/utils/request'

// 获取房产列表
export function getHouseList(params) {
  return request({
    url: '/properties',
    params
  })
}

// 新增房产
export function addHouse(data) {
  return request({
    url: '/properties',
    method: 'POST',
    data
  })
}
// 获取房产详情
export function getHouseDetails(id) {
  return request({
    url: `/properties/${id}`
  })
}

// 编辑房产
export function updateHouse(data) {
  return request({
    url: `/properties/${data.id}`,
    method: 'PUT',
    data
  })
}

// 删除房产
export function deleteHouse(id) {
  return request({
    url: `/properties/${id}`,
    method: 'delete'
  })
}

// 获取经纪数量
export function getHouseCount() {
  return request({
    url: '/properties/count'
  })
}

